function Traits()
{
	this.checkTrait = function(trait)
	{
		for(var object in game.logic.person.traits)
		{
			if(game.logic.person.traits[object].name == trait)
				return true;
		}
		return false;
	}
	this.getBackground = function()
	{
		var seed = Math.round(Math.random()*(this.traits.background.length -1));
		return this.traits.background[seed];
	}
	this.getLifestyle = function()
	{
		var seed = Math.round(Math.random()*(this.traits.lifestyle.length-1));
		var trait = this.traits['lifestyle'][seed];
		while(this.checkTrait(trait.name))
		{
			seed = Math.round(Math.random()*(this.traits.lifestyle.length-1));
			trait = this.traits.lifestyle[seed];
		}
		return trait;
	}
// Traits have two catagories, background and lifestyle. A character has one background and multiple 
// backgrounds. Each trait will effect starting stats and may influence some events.
	this.traits = {
		background: 
		[
			{
				name: 'Rich Dad',
				description: 'Your parents are wealthy!',
				execute: function()
				{
					game.logic.person.money += 1000 + Math.round(1000*(1-game.difficulty));
					var freeIncome = function()
					{
						game.logic.person.money += 200 + Math.round(300*(1-game.difficulty));
					};
					game.manager.addToInventory(
						'Dad Money',
						freeIncome,
						14,
						0,
						'Dad gives you some more money to aid your adventure!',
						false
					);
				}
			},
			{
				name: 'Poor Dad',
				description: 'Your parents are poor :(',
				execute: function()
				{
					//immediate modifications 
					game.logic.person.money += Math.round(500*(1-game.difficulty));
					
					//later
					var needyParents = function(){
						game.logic.person.money -= 400;
						game.logic.person.happiness -= 5 + Math.round(5*game.difficulty);
					};
					//add the event to the inventory
					game.manager.addToInventory(
						'Needy Parents', //name
						needyParents, //function to execute
						-1, //freq
						.05, //prob
						'Your parents need to borrow money from you', //description
						false //display?
					); 
				}
			},
			{
				name: 'Strict Dad',
				description: 'Your Dad\'s expectations are insatiable',
				execute: function()
				{
					game.logic.person.money += 1000 + Math.round(1000*(1-game.difficulty));
					var dadMessage = '"You must maintain your grades if you want my money!"-Dad';
					var strictTest = function() 
					{
						if(game.logic.person.gpa > 3.5)
						{
							game.logic.person.money += 200 + Math.round(200*(1-game.difficulty));
							dadMessage = '"I am proud of you son, I know you will be a doctor or lawyer some day."-Dad';
						}
						else
						{
							game.logic.person.happiness -= 5 + Math.round(5*(game.difficulty));
						}
					};
					game.manager.addToInventory(
						'Strict Father',
						strictTest,
						12,
						0,
						dadMessage,
						false
					);
				}
			},
			{
				name: 'Self Sufficient',
				description: 'You always seem to scrape by',
				execute: function()
				{
					game.logic.person.money += 500 + Math.round(500*(1-game.difficulty));
					var naturalIncome = function()
					{
						game.logic.person.money += 100*game.difficulty;
					};
					game.manager.addToInventory(
						'Natural Income',
						naturalIncome,
						12,
						0,
						'Pop cans, sidewalk money, and craiglist ads sure do add up over a month',
						false
					);
				}
			}
		],
		lifestyle: 
		[
			{
				name: 'Alcoholism',
				description: 'You are vunerable to fermented beverages',
				execute: function()
				{
					//initial effects
					game.logic.person.happiness -= 2 + Math.round(5*game.difficulty);
					var alcholism = function()
					{
						game.logic.person.happiness -= 10;
						game.logic.person.money -= 300*(1-game.difficulty);
					
					}
					game.manager.addToInventory(
						'Back to your old ways',
						alcholism,
						-1,
						.05,
						'Another rough night has cost you',
						false
					);
				}
			},
			{
				name: 'Fashion Conscience',
				description: 'You are a slave to the latest trends',
				execute: function()
				{
					game.logic.person.happiness += 2 +Math.round(5*(1-game.difficulty));
					var updateWardrobe = function() 
					{
						game.logic.person.happiness += 2 + Math.round(3*(1-game.difficulty));
						game.logic.person.money -= (100 + 50*Math.random())*game.difficulty + 50;
					};
					game.manager.addToInventory(
						'Wardrobe Update',
						updateWardrobe,
						13,
						0,
						'There\'s a price to be so dang fashionable',
						false
					);
				}	
			},
			{
				name: 'First In Class',
				description: 'The most eager of beavers when education is concerned',
				execute: function()
				{
					//high school scholarship? full ride?
					game.logic.person.money += 500 + Math.round(500*(1-game.difficulty));
					var studyHabit = function() 
					{
						game.logic.person.timesStudied += 1;
					}
					game.manager.addToInventory(
						'Study Habits',
						studyHabit,
						3,
						0,
						'You hit the books',
						false
					);
				}
			},
			{
				name: 'Bi-Polar',
				description: 'Prone to mood shifts',
				execute: function()
				{
					var moodSwing = function()
					{
						if( (100-game.logic.person.happiness) < 50)
						{
							game.logic.person.happiness = 75;
						}
						else
						{
							game.logic.person.happiness = 25;
						}
						
					
					}
					game.manager.addToInventory(
					'Mood Swing',
					moodSwing,
					-1,
					.02,
					'Welcome to the other polarity, friend',
					false
					);
				}
			},
			{
				name: 'Savant',
				description: 'Able to pick up the most subtle of intricacies. Also very talented piano player',
				execute: function()
				{
					//picks up stuff easily, times studied at the end?
					var glueMind = function()
					{
						game.logic.person.timesStudied += 3;
					
					}
					game.manager.addToInventory(
						'Savant Mind Powers',
						glueMind,
						-1,
						.1,
						'Your studies came easy today',
						false
					);
				}
			},
			{
				name: 'Pot Head',
				description: 'It\'s 4:20 somewhere',
				execute: function()
				{
					game.logic.person.happiness = 90;
					game.logic.person.money -= 300 + Math.round(300*(game.difficulty));
					var blazeIt = function()
					{
						game.logic.person.money -= 140 + Math.round(140*(game.difficulty));
						game.logic.person.happiness += 3 + Math.round(5*(1-game.difficulty));
						game.logic.person.timesPartied++;
					};
					
					game.manager.addToInventory(
						'4:20',
						blazeIt,
						7,
						0,
						'Even a stopped clock is right twice a day',
						false
					);
				}
			},
			{
				name: 'Ramen Noodle Afficionado',
				description: '20 cents goes a long way with some soy sauce',
				execute: function()
				{
					var cheapFood = function()
					{
						game.logic.person.money += 30;
					
					};
					game.manager.addToInventory(
						'Cheap food',
						cheapFood,
						30,
						0,
						'20 cents goes a long way with some soy sauce',
						false
					);
				}
			},
			{
				name: 'Meat Head',
				description: 'You watched too much WWF in your formative years',
				execute: function()
				{
					var getHuge = function()
					{
						game.logic.person.money += -300;
						game.logic.person.happiness += 3;
					
					}
					game.manager.addToInventory(
						'Strive to be massive',
						getHuge,
						8,
						0,
						'New pre-workout is working great!',
						false
					);
				}
			},
			{
				name: 'LARP enthusiast',
				description: 'The thrill of battle sustains you',
				execute: function()
				{
					var larpClub = function()
					{
						game.logic.person.money += -50;
						game.logic.person.happiness += 3 + 3*(1-game.difficulty);
					
					}
					game.manager.addToInventory(
						'Larp Club',
						larpClub,
						13,
						0,
						'It\'s all out foam warfare, just make sure you pick up your socks!',
						false
					
					);
				}
			}
		]
	};
}